package learn.advance.set1;

import java.util.*;

class Demo1Set {
    public static void Test() {
        Set<Integer> set = new HashSet<>();
        set.add(1);
        set.add(2);
        set.add(3);
        for (Integer integer : set) {
            System.out.println(integer);
        }
        System.out.println("===========");

    }
}


class Demo4LinkedHashSet {
    public static void Test() {
        HashSet<String> set = new HashSet<>();
        set.add("www");
        set.add("abc");
        set.add("abc");

        System.out.println(set.size());
        System.out.println(set);

        LinkedHashSet<String> linked = new LinkedHashSet<>();
        linked.add("www");
        linked.add("abc");
        linked.add("abc");

        System.out.println(linked);
    }
}












public class TestSet {
    public static void main(String[] args) {
        // Demo1Set.Test();
        Demo4LinkedHashSet.Test();
    }
}
